import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Row, Col, Button, Icon } from 'antd';
import {RmsFilesDown} from 'knk';


class RmsFilesDownDemo extends Component {
    constructor(props) {
        super(props);
        this.state = {
            data: {}
        };
    }

    componentDidMount() {
    }

    componentWillUnmount() {
    }

    render() {    
        const path = 'https://rms.test.zbjdev.com/resource/redirect?key=homesite%2Ftask%2F%E6%91%A9%E6%89%98%E8%BD%A6%E8%B4%B4%E7%BA%B81.jpg%2Forigine%2F06db8589-589f-486d-a61b-ddf50391778a'; 
        return (
            <div>
                <Row style={{marginTop: 20}}>
                    <Col span={4}><div>文件下载：</div></Col>
                    <Col span={20}>
                        <RmsFilesDown 
                            showTip='正在获取下载地址'  
                            url={path}
                            content={<Button>下载</Button>}   
                            filename="案例文件(JSONP)"
                        />
                    </Col>
                </Row>
                <Row style={{marginTop: 20}}>
                    <Col span={4}><div>图片下载：</div></Col>
                    <Col span={20}>
                        <img src={path} alt="扫描件" style={{width: 200, height: 200}}/>
                        <div style={{left: 180, top: 10, position: 'absolute'}}>
                            <RmsFilesDown 
                                showTip='正在获取下载地址'  
                                url={path}
                                content={<Icon type="download" className="delete-icon"/>}   
                                filename="扫描件"
                            />
                        </div>
                    </Col>
                </Row>
            </div>
        );
    }
}

RmsFilesDownDemo.propTypes = {
};

export default RmsFilesDownDemo;